<%@ page import="java.util.List" %>
<%@ page import="java.util.ArrayList" %>
<%@ page import="com.zhangliang.stu.Student" %><%--
  Created by IntelliJ IDEA.
  User: z9413
  Date: 2022/3/19
  Time: 16:59
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<%
    List<Student> stuList = new ArrayList<>();
    Student s1 = new Student("张三",18,true);
    Student s2 = new Student("李四",17,false);
    Student s3 = new Student("王五",19,true);

    stuList.add(s1);
    stuList.add(s2);
    stuList.add(s3);

    request.setAttribute("stu",stuList);
%>
<c:forEach items="${stu}" var="student">
    name:${student.name},age:${student.age},sex:${student.sex}<br>
</c:forEach>
</body>
</html>
